<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <title>管理员登录</title>
    <style>
        body { font-family: Arial, sans-serif; }
        .login-container { width: 300px; margin: 0 auto; padding: 20px; border: 1px solid #ddd; border-radius: 5px; }
        .login-container h2 { text-align: center; }
        .login-container input { width: 100%; padding: 10px; margin: 8px 0; box-sizing: border-box; }
        .login-container button { width: 100%; background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; border-radius: 4px; cursor: pointer; }
        .error-message { color: red; text-align: center; }
    </style>
    <script>
        function validateLogin() {
            let username = document.getElementById("username").value;
            let password = document.getElementById("password").value;
            if (username === "" || password === "") {
                document.getElementById("errorMessage").innerText = "账户和密码不能为空";
                return false;
            }
            return true;
        }
    </script>
</head>
<body>
<div class="login-container">
    <h2>管理员登录</h2>
    <form action="admin/login" method="post" onsubmit="return validateLogin()">
        <input type="text" id="username" name="username" placeholder="账户">
        <input type="password" id="password" name="password" placeholder="密码">
        <button type="submit">登录</button>
    </form>
    <p id="errorMessage" class="error-message">${errorMessage}</p>
</div>
</body>
</html>